function w = jiaoji(f1,f2)
a = f1;
b = f2;
c = [a,b];
c = sort(c);
flag = -1;
result = -1;
index = 1;
for i = 1:length(c)
    if(((c(i)>=a(1)) && (c(i)<=a(2))) && ((c(i)>=b(1))&&(c(i)<=b(2))))
        result(index) = c(i);
        index = index+1;
        flag = 0;
    end
end
if (flag==-1)
    inter = result;
else
    inter = unique(result);
end
if size(inter,2) == 1
    w = 0;
else
    w = inter(2) - inter(1);
end

